package com.fgi.springframework.beans.factory;

import com.fgi.springframework.beans.BeansException;

/**
 * @author HanXu
 * @date 2022/11/18
 * Bean工厂，提供获取bean的操作
 **/
public interface BeanFactory {

    Object getBean(String name) throws BeansException;

    Object getBean(String name, Object... args) throws BeansException;

    /**
     * 丰富上一个 BeanFactory 版本的 getBean 方法
     *
     * 按照类型返回 Bean 实例
     *
     * @param name
     * @param requiredType
     * @param <T>
     * @return
     * @throws BeansException
     */
    <T> T getBean(String name, Class<T> requiredType) throws BeansException;

}

